package com.gca.airhockey;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.entity.primitive.Rectangle;
import org.anddev.andengine.entity.shape.Shape;
import org.anddev.andengine.extension.physics.box2d.PhysicsFactory;
import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;

import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.FixtureDef;

import android.content.Context;


public class Wall implements IPhysicalObject{
	private Shape mShape;
	private Body mBody;

	// ===========================================================
	// Constructors
	// ===========================================================
	public Wall(Context pContext, Engine engine,PhysicsWorld physicsWorld, Rectangle pRectangle) {
		mShape = pRectangle;
		final FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 2f, 0);
		mBody = PhysicsFactory.createBoxBody(physicsWorld, mShape, BodyType.StaticBody, wallFixtureDef);
		mBody.setUserData(this);
		//physicsWorld.registerPhysicsConnector(new PhysicsConnector(mSprite, mBody, true, true));					
	}

	// ===========================================================
	// Getters and Setters
	// ===========================================================
	public Shape getShape() {
		return mShape;
	}
	public Body getBody() {                                                                                                                                                                                
		return mBody;
	}
	
	@Override
	public String toString() {
		return "Wall";
	}
}

